import request from '@/utils/request'
export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

/**
* 添加部门
* @return: 添加的结果
*/
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
* 根据ID 查询部门详情
* @return: 部门详情
*/
export function getDepartmentById(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

/**
* 根据ID 修改部门详情
* @return: 部门详情
*/
export function updateDepartmentById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}

/**
* 根据ID 删除部门
* @return: 删除
*/
export function delDepartmentById(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
